{% extends "base.html" %}

{% block content %}
<div class="container mt-4">
    <h2>创建业务层级</h2>
    <div class="card">
        <div class="card-body">
            <form method="POST">
                {{ form.hidden_tag() }}
                <div class="mb-3">
                    {{ form.node_id.label(class="form-label") }}
                    {{ form.node_id(class="form-control") }}
                    <div class="form-text">唯一节点ID，如DOM-SCM</div>
                </div>
                <div class="mb-3">
                    {{ form.parent_id.label(class="form-label") }}
                    {{ form.parent_id(class="form-select") }}
                </div>
                <div class="mb-3">
                    {{ form.level.label(class="form-label") }}
                    {{ form.level(class="form-select") }}
                </div>
                <div class="mb-3">
                    {{ form.code.label(class="form-label") }}
                    {{ form.code(class="form-control") }}
                    <div class="form-text">层级编码，如SCM</div>
                </div>
                <div class="mb-3">
                    {{ form.name.label(class="form-label") }}
                    {{ form.name(class="form-control") }}
                </div>
                <div class="mb-3">
                    {{ form.version.label(class="form-label") }}
                    {{ form.version(class="form-control") }}
                </div>
                <button type="submit" class="btn btn-primary">保存</button>
                <a href="{{ url_for('hierarchy.index') }}" class="btn btn-secondary">取消</a>
            </form>
        </div>
    </div>
</div>
{% endblock %}